package com.wetao.flexiblerichtextview;

import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.daquexian.flexiblerichtextview.FlexibleRichTextView;
import com.daquexian.flexiblerichtextview.FormatUtil;
import com.daquexian.flexiblerichtextview.MyConfige;
import com.wetao.flexiblerichtextview.bean.ExamData;
import com.wetao.flexiblerichtextview.bean.ExamData_2;
import com.wetao.flexiblerichtextview.bean.ExamData_3;

import java.util.ArrayList;
import java.util.List;


public class Student03Activity extends AppCompatActivity implements View.OnClickListener, FlexibleRichTextView.OnFlexibleListener{

    private static final String TAG = "Student03";

    //private String str_00 = "<p style=\"text-align:center;\"><span style=\"font-family: Source Han Sans CN Medium;\">清塘荷韵</span></p><p style=\"text-align:center;\"><span style=\"font-family: Source Han Sans CN Medium;\">季羡林</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">①</span><span style=\"font-family: Source Han Sans CN;\">楼前有清塘数亩。记得三十多年前初搬来时</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池塘里好像是有荷花的</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我的记忆里还残留着一些绿叶红花的碎影。后来时移事迁</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">岁月流逝</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池塘里却变得“半亩方塘一鉴开</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">天光云影共徘徊”</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">再也不见什么荷花了。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">②</span><span style=\"font-family: Source Han Sans CN;\">我脑袋里保留的旧的思想意识颇多</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">每一次望到空荡荡的池塘</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">总觉得好像缺点什么。这不符合我的审美观念。有池塘就应当有点绿的东西</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">哪怕是芦苇呢</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">也比什么都没有强。最好的最理想的当然是荷花。中国旧的诗文中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">描写荷花的简直是太多太多了。周敦颐的《爱莲说》</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">读书人不知道的恐怕是绝无仅有的。他那一句有名的“香远益清”是脍炙人口的。几乎可以说</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">中国人没有不爱荷花的。可我们楼前池塘中独独缺少荷花。每次看到或想到</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">总觉得是一块心病。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">③</span><span style=\"font-family: Source Han Sans CN;\">有人从湖北来</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">带来了洪湖的几颗莲子</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">外壳呈黑色</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">极硬。据说</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">如果埋在淤泥中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">能够千年不烂。因此</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我用铁锤在莲子上砸开了一条缝</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">让莲芽能够破壳而出</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">不至于永远埋在泥中。这都是一些主观的愿望</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">莲芽能不能长出</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">都是极大的未知数。反正我总算是尽了人事</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">把五六颗敲破的莲子投入池塘中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">下面就是听天由命了。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">④</span><span style=\"font-family: Source Han Sans CN;\">这样一来</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我每天就多了一件工作</span><span style=\"font-family: Source Han Sans CN;\">:</span><span style=\"font-family: Source Han Sans CN;\">到池塘边上去看上几次。心里总是希望</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">忽然有一天</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">“小荷才露尖尖角”</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">有翠绿的莲叶长出水面。可是</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">事与愿违</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">投下去的第一年</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">一直到秋凉落叶</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">水面上也没有出现什么东西。经过了寂寞的冬天</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">到了第二年</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">春水盈塘</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">绿柳垂丝</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">一片旖旎的风光。可是</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我翘盼的水面上却仍然没有露出什么荷叶。此时我已经完全灰了心</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">以为那几颗湖北带来的硬壳莲子</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">由于无法解释的原因</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">大概不会再有长出荷花的希望了。我的目光无法把荷叶从淤泥中吸出。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑤</span><span style=\"font-family: Source Han Sans CN;\">但是</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">到了第三年</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">却忽然出了奇迹。有一天</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我忽然发现</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">在我投莲子的地方长出了几个圆圆的绿叶</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">虽然颜色极惹人喜爱</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">但是细弱单薄</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">可怜兮兮地平卧在水面上</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">像水浮莲的叶子一样</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而且最初只长出了五六个叶片。我总嫌这有点太少</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">总希望多长出几片来。于是</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我盼星星</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">盼月亮</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">天天到池塘边上去观望。有校外的农民来捞水草</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我总请求他们手下留情</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">不要碰断叶片。但是经过了漫漫的长夏</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">凄清的秋天又降临人间</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池塘里浮动的仍然只是孤零零的那五六个叶片。对我来说</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">这又是一个虽微有希望但究竟仍是令人灰心的一年。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑥</span><span style=\"font-family: Source Han Sans CN;\">真正的奇迹出现在第四年。严冬一过</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池塘里又溢满了春水。到了一般荷花长叶的时候</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">在去年飘浮着五六个叶片的地方</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">一夜之间</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">突然长出了一大片绿叶</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而且看来荷花在严冬的冰下并没有停止行动</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">因为在离开原有五六个叶片的那块基地比较远的池塘中心</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">也长出了叶片。叶片扩张的速度</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">范围的扩大</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">都是惊人地快。几天之内</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池塘内不小一部分</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">已经全为绿叶所覆盖。而且原来平卧在水面上的像是水浮莲一样的叶片</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">不知道是从哪里积蓄了力量</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">有一些竟然跃出了水面</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">长成了亭亭的荷叶。原来我心中还迟迟疑疑</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">怕池中长的是水浮莲</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而不是真正的荷花。这样一来</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我心中的疑云一扫而光</span><span style=\"font-family: Source Han Sans CN;\">:</span><span style=\"font-family: Source Han Sans CN;\">池塘中生长的真正是洪湖莲花的子孙了。我心中狂喜</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">这几年总算是没有白等。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑦</span><span style=\"font-family: Source Han Sans CN;\">天地萌生万物</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">对包括人在内的动植物等有生命的东西</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">总是赋予一种极其惊人的求生存的力量和极其惊人的扩展蔓延的力量</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">这种力量大到无法抗御。只要你肯费力来观察一下</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">就必然会承认这一点。现在摆在我面前的就是我楼前池塘里的荷花。自从几个勇敢的叶片跃出水面以后</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">许多叶片接踵而至。一夜之间</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">就出来了几十枝</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而且迅速地扩散、蔓延。不到十几天的工夫</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">荷叶已经蔓延得遮蔽了半个池塘。从我撒种的地方出发</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">向东西南北四面扩展。我无法知道</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">荷花是怎样在深水中淤泥里走动的。反正从露出水面的荷叶来看</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">每天至少要走半尺的距离</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">才能形成眼前这个局面。</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑧</span><span style=\"font-family: Source Han Sans CN;\">光长荷叶</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">当然是不能满足的。荷花接踵而至</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而且据了解荷花的行家说</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我门前池塘里的荷花</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">同燕园其他池塘里的都不一样。其他地方的荷花</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">颜色浅红</span><span style=\"font-family: Source Han Sans CN;\">;</span><span style=\"font-family: Source Han Sans CN;\">而我这里的荷花</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">不但红色浓</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">而且花瓣多</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">每一朵花能开出十六个复瓣</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">看上去当然就与众不同了。这些红艳耀目的荷花</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">高高地凌驾于莲叶之上</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">迎风弄姿</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">似乎在睥睨一切。幼时读旧诗</span><span style=\"font-family: Source Han Sans CN;\">:</span><span style=\"font-family: Source Han Sans CN;\">“毕竟西湖六月中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">风光不与四时同。接天莲叶无穷碧</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">映日荷花别样红。”爱其诗句之美</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">深恨没有能亲自到杭州西湖去欣赏一番。现在我门前池塘中呈现的就是那一派西湖景象。是我把西湖从杭州搬到燕园里来了。岂不大快人意也哉</span><span style=\"font-family: Source Han Sans CN;\">!</span><span style=\"font-family: Source Han Sans CN;\">前几年才搬到朗润园来的周一良先生赐名为“季荷”。我觉得很有趣</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">又非常感激。难道我这个人将以荷而传吗</span><span style=\"font-family: Source Han Sans CN;\">?</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑨</span><span style=\"font-family: Source Han Sans CN;\">前年和去年</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">每当夏月塘荷盛开时</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">我每天至少有几次徘徊在塘边</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">坐在石头上</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">静静地吸吮荷花和荷叶的清香。“蝉噪林愈静</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">鸟鸣山更幽。”我确实觉得四周静得很。我在一片寂静中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">默默地坐在那里</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">水面上看到的是荷花的绿肥、红肥。倒影映入水中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">风乍起</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">一片莲瓣堕入水中</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">它从上面向下落</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">水中的倒影却是从下边向上落</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">最后一接触到水面</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">二者合为一</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">像小船似的漂在那里。我曾在某一本诗话上读到两句诗</span><span style=\"font-family: Source Han Sans CN;\">:</span><span style=\"font-family: Source Han Sans CN;\">“池花对影落</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">沙鸟带声飞。”作者深惜第二句对仗不工。这也难怪</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">像“池花对影落”这样的境界究竟有几个人能参悟透呢</span><span style=\"font-family: Source Han Sans CN;\">?</span></p><p style=\"text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">⑩</span><span style=\"font-family: Source Han Sans CN;\">连日来</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">天气突然变寒。池塘里的荷叶虽然仍是绿油油的一片</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">但是看来变成残荷之日也不会太远了。再过一两个月</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">池水一结冰</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">连残荷也将消逝得无影无踪。那时荷花大概会在冰下冬眠</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">做着春天的梦。它们的梦一定能够圆。“冬天如果来了</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">春天还会远吗</span><span style=\"font-family: Source Han Sans CN;\">?</span><span style=\"font-family: Source Han Sans CN;\">”我为我的“季荷”祝福。</span></p><p style=\"text-align:right;text-indent:2.0em;\"><span style=\"font-family: Source Han Sans CN;\">（</span><span style=\"font-family: Source Han Sans CN;\">选自《季羡林散文》</span><span style=\"font-family: Source Han Sans CN;\">，</span><span style=\"font-family: Source Han Sans CN;\">有删改</span><span style=\"font-family: Source Han Sans CN;\">）</span></p>";
    //private String str_00 = "<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/2020-08-07%2008.15.07.jpg\"/>";
    //private String str_00 = "<img src=\\\"mnt/sdcard/课程封面1.png\\\"/>";
    private String str_00 = "<img src=\"mnt/sdcard/课程封面1.png\"/>";
    private String str_01 = "<latex>$$ \\left(\\frac{1}{2}\\text{,}\\frac{\\sqrt{3}}{2\\mathrm{ }}\\right) $$</latex>";
    private String str_02 = "<latex>$$ \\left(\\text{-}\\frac{1}{2}\\text{,}\\frac{\\sqrt{3}}{2\\mathrm{ }}\\right) $$</latex>";
    private String str_03 = "<latex>$$ \\left(\\text{-}\\frac{1}{2}\\text{,-}\\frac{\\sqrt{3}}{2\\mathrm{ }}\\right) $$</latex>";
    private String str_04 = "<latex>$$ \\left(\\text{-}\\frac{\\sqrt{3}}{2}\\text{,}\\frac{1}{2\\mathrm{ }}\\right) $$</latex> <table><tr><td>11111111</td><td>2222222</td></tr></table> \n aa\n bb\n cc\n dd\nqq\ndd\ncc\nyy";

    private String str_05 = "<p>  由实数<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/42a04c4a23044daab5d2c9bcf5cdbe0b.jpg\" style=\"width:9pt;\" />, <img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/d96fb837f1c4443a8a68f26bb77ad68b.jpg\" style=\"width:15pt;\" />, <img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/2245af47a21c4b0fb66475bea248c851.jpg\" style=\"width:12.75pt;\" />, <img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/6049ded1a6f24708970e53395379fe16.jpg\" style=\"width:21.75pt;\" />, <img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/fa1b4b2fb75648fdad73677e044e353f.jpg\" style=\"width:27pt;\" />所组成的集合，最多含有的元素个数为 ( )</p>";
    private String str_06 =" <img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/e69b03e1d333482fa678a1486eb2bc55.jpg\" style=\"width:9pt;\" /> ";
    private String str_07 = "<p style=\"line-height:1.5;\">实数<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/2aee07023d58423392a293d28d08c180.jpg\" style=\"width:45.75pt;\" />，<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/e54d227c9c4d4cb8a2469c03e588a463.jpg\" style=\"width:41.25pt;\" />，<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/919aa7b4f39847f9ab9f7a38b4cd63d1.jpg\" style=\"width:39.75pt;\" />从小到大排列为<u>                   </u>．</p>";
    private String str_08 = "<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/f02e3cdf61f047da88d2c01b02845660.jpg\" style=\"width:35.25pt;\" /> " + "<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/8f2dd9f76c1442c4af7d1bb24b8fa763.jpg\" style=\"width:33.75pt;\" />";

    private String str_09 = "99999<p style=\"line-height:1.2;\"><b>（</b><b>2018年</b><b>·</b><b>北京卷</b><b>）</b>假设你是红星中学高三学生李华，请根据以下四幅图的先后顺序，写一篇英文周记，记述你们上周接待外国学生，带领他们体验中国茶文化的全过程。注意：词数不少于60。<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/a634f934688e407fb18e888fe1c4a5b1.jpg\" style=\"width:346px;height:247px;\" /></p>";
    private String str_10 = "88888<p style=\"line-height:1.2;\"><b>（</b><b>2018年</b><b>·</b><b>北京卷</b><b>）</b>假设你是红星中学高三学生李华，请根据以下四幅图的先后顺序，写一篇英文周记，记述你们上周接待外国学生，带领他们体验中国茶文化的全过程。注意：词数不少于60。<img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/a634f934688e407fb18e888fe1c4a5b1.jpg\" style=\"width:346px;height:247px;\" /></p>";

    private String str_11 = "<p>（<b>江苏省泰州中学2017-2018学年高二下学期英语6月调研测试</b>）</p><p style=\"line-height:1.2;\"><span style=\"font-family: Times New Roman\">在</span><span style=\"font-family: Times New Roman\">旱</span><span style=\"font-family: Times New Roman\">灾和震灾中的孩子们虽然通到了无法想象的困难，但他们仍然没有放弃学习。请简要描述这两张照片，并谈谈你的感想。</span><span style=\"font-family: Times New Roman\">文章的开头已经给出</span><span style=\"font-family: Times New Roman\">。</span></p><table border=\"1\"  cellspacing=\"0\" width=\"817\" ><tr><td><p style=\"line-height:1.2;\"><img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/c44ff04d4a9840b3b1826cab9738f0b5.png\" style=\"width:264px;height:214px;\" /></p></td><td><p style=\"line-height:1.2;\"><img src=\"http://newpage-edu.oss-cn-beijing.aliyuncs.com/38048f992a424ced9d9b2db373aaa91f.png\" style=\"width:279px;height:221px;\" /></p></td></tr><tr><td><p style=\"line-height:1.2;\"><span style=\"font-family: Times New Roman\">在干旱的云南省的一所小学中，孩子们虽然面临饮水和饥饿的困扰，但他们还是在认真听讲。</span></p></td><td><p style=\"line-height:1.2;\"><span style=\"font-family: Times New Roman\">一位上小学二年级的女童紧抱着自己的课本，站在震后的废墟前。</span></p></td></tr></table><p style=\"line-height:1.2;\"><span style=\"font-family: Times New Roman\">注意：词数</span><span style=\"font-family: Times New Roman\">150</span><span style=\"font-family: Times New Roman\">左右。开头已经写好，不计入总词数。</span><span style=\"font-family: Times New Roman\">    </span><span style=\"font-family: Times New Roman\">Natural disasters left students in miserable life. However, they never gave up study.    </span></p>";

    private String str_12 =  "<p style=\"line-height:1.2208333;\">设0≤<i>α&lt;</i>2π,若sin <i>α&gt;</i><latex>$$ \\sqrt{3} $$</latex>cos <i>α</i>,则角<i>α</i>的取值范围是(<i>  </i>)<i>.</i></p>";
    private String str_13 = "<latex>$$ \\left(\\frac{\\mathrm{\\pi }}{3}\\text{,}\\frac{\\mathrm{\\pi }}{2}\\right) $$</latex>";
    private String str_14 = "<latex>$$ \\left(\\frac{\\mathrm{\\pi }}{3}\\text{,}\\mathrm{\\pi }\\right) $$</latex>";
    private String str_15 = "<latex>$$ \\left(\\frac{\\mathrm{\\pi }}{3}\\text{,}\\frac{4\\mathrm{\\pi }}{3}\\right) $$</latex>";
    private String str_16 = "<latex>$$ \\left(\\frac{\\mathrm{\\pi }}{3}\\text{,}\\frac{\\mathrm{\\pi }}{2}\\right) $$</latex>∪<latex>$$ \\left(\\frac{4\\mathrm{\\pi }}{3}\\text{,}\\frac{3\\mathrm{\\pi }}{2}\\right) $$</latex>";

    private static final int HANDLER_FIRST_LOAD = 1;
    private static final int HANDLER_COMPLETE_DELEYED = 2;
    private static final int HANDLER_SHOW_SCROLL_VIEW = 3;
    private static final int HANDLER_SCROLL_BY = 4;

    private boolean isTurnNoneShow = false;  //是否在翻页的隐藏scrollView,然后显示出来（为了肉眼看不出滚动效果，和尝试处理残影）
    private boolean isTurnPage = true;  //是翻页显示还是滚动显示
    private LinearLayout lyt_page_bottom;
    private Button btn_page_prev;
    private Button btn_page_next;
    private TextView tv_page_num;
    private int currentPage = 0;
    private int totalPage = 0;
    private int totalHeight = 0;
    private int currentHeight = 0;
    private ScrollView sv_question;

    private int frtvCount = 0;

    StringBuilder stringBuilder = null;
    List<FlexibleRichTextView> frtvList = new ArrayList<>(); //判断所有的布局都加载完成了，然后显示翻页控件，然后可以对换题操作
    List<ImageView> singleList = new ArrayList<>(); //可以选择的控件，单选题

    private LinearLayout lyt_content;

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case HANDLER_FIRST_LOAD:{
                    test_01();
                }break;
                case HANDLER_COMPLETE_DELEYED:{
                    currentHeight = sv_question.getHeight();
                    totalHeight = sv_question.getChildAt(0).getHeight();
                    if(totalHeight > currentHeight) {
                        lyt_page_bottom.setVisibility(View.VISIBLE);
                        float f_totalPage = totalHeight/(currentHeight * MyConfige.scroll_by_page_percent);
                        int floor_totalPage = (int)(Math.floor(f_totalPage));
                        if((f_totalPage - floor_totalPage) * (currentHeight * MyConfige.scroll_by_page_percent) > (currentHeight * (1 - MyConfige.scroll_by_page_percent))) {
                            totalPage = floor_totalPage + 1;
                        } else {
                            totalPage = floor_totalPage;
                        }

                        Log.e(TAG, "滚动高度：h1 = " + currentHeight + ", h2 = " + totalHeight + ", f_totalPage = " + f_totalPage + ", totalPage = " + totalPage);
                        refreshPageView();
                    }

                }break;
                case HANDLER_SHOW_SCROLL_VIEW:{
                    sv_question.setVisibility(View.VISIBLE);
                }break;
                case HANDLER_SCROLL_BY:{
                    int by = msg.arg1;
                    sv_question.scrollBy(0, by);
                    refreshPageView();
                    handler.sendEmptyMessageDelayed(HANDLER_SHOW_SCROLL_VIEW, 100);
                }break;
            }
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_student03);

        //禁止上下滚动
        sv_question = (ScrollView)findViewById(R.id.sv_question);
        if(isTurnPage) {
            sv_question.setOnTouchListener(new View.OnTouchListener(){
                @Override
                public boolean onTouch(View arg0, MotionEvent arg1) {
                    return true;
                }
            });
        }

        lyt_page_bottom = (LinearLayout)findViewById(R.id.lyt_page_bottom);
        btn_page_prev = (Button) findViewById(R.id.btn_page_prev);
        btn_page_next = (Button) findViewById(R.id.btn_page_next);
        tv_page_num = (TextView) findViewById(R.id.tv_page_num);

        lyt_content = (LinearLayout)findViewById(R.id.lyt_content);

        Button btn_0 = (Button) findViewById(R.id.btn_0);
        Button btn_1 = (Button) findViewById(R.id.btn_1);
        Button btn_2 = (Button) findViewById(R.id.btn_2);
        Button btn_3 = (Button) findViewById(R.id.btn_3);
        Button btn_4 = (Button) findViewById(R.id.btn_4);
        Button btn_5 = (Button) findViewById(R.id.btn_5);
        Button btn_6 = (Button) findViewById(R.id.btn_6);
        Button btn_7 = (Button) findViewById(R.id.btn_7);
        Button btn_8 = (Button) findViewById(R.id.btn_8);

        btn_page_prev.setOnClickListener(this);
        btn_page_next.setOnClickListener(this);

        btn_0.setOnClickListener(this);
        btn_1.setOnClickListener(this);
        btn_2.setOnClickListener(this);
        btn_3.setOnClickListener(this);
        btn_4.setOnClickListener(this);
        btn_5.setOnClickListener(this);
        btn_6.setOnClickListener(this);
        btn_7.setOnClickListener(this);
        btn_8.setOnClickListener(this);


        /*frtv_00 = (FlexibleRichTextView) findViewById(R.id.frtv_00);
        frtvList.add(frtv_00);
        frtv_00.setOnFlexibleListenerr(this);
        frtv_01 = (FlexibleRichTextView) findViewById(R.id.frtv_01);
        frtvList.add(frtv_01);
        frtv_01.setOnFlexibleListenerr(this);
        frtv_02 = (FlexibleRichTextView) findViewById(R.id.frtv_02);
        frtvList.add(frtv_02);
        frtv_02.setOnFlexibleListenerr(this);*/

        //必须延时一点时间再加载数据，原因是html解析需要一点时间，所以要界面先显示再加载。
        handler.sendEmptyMessageDelayed(HANDLER_FIRST_LOAD, 50);

    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_page_prev:{
                currentPage--;
                if(isTurnNoneShow) {
                    sv_question.setVisibility(View.INVISIBLE);
                    Message msg = handler.obtainMessage();
                    msg.what = HANDLER_SCROLL_BY;
                    msg.arg1 = -(int) (currentHeight * MyConfige.scroll_by_page_percent);
                    handler.sendMessageDelayed(msg, 50);
                    //handler.sendEmptyMessageDelayed(HANDLER_SHOW_SCROLL_VIEW, 100);
                } else {
                    sv_question.scrollBy(0, -(int)(currentHeight * MyConfige.scroll_by_page_percent));
                    refreshPageView();
                }


            }break;
            case R.id.btn_page_next:{
                currentPage++;
                if(isTurnNoneShow) {
                    sv_question.setVisibility(View.INVISIBLE);
                    Message msg = handler.obtainMessage();
                    msg.what = HANDLER_SCROLL_BY;
                    msg.arg1 = (int) (currentHeight * MyConfige.scroll_by_page_percent);
                    handler.sendMessageDelayed(msg, 100);
                    //handler.sendEmptyMessageDelayed(HANDLER_SHOW_SCROLL_VIEW, 100);
                } else {
                    sv_question.scrollBy(0, (int)(currentHeight * MyConfige.scroll_by_page_percent));
                    refreshPageView();
                }

            }break;

            case R.id.btn_0:{
                click_btn_0();
            }break;

            case R.id.btn_1:{
                click_btn_1();
            }break;

            case R.id.btn_2:{
                click_btn_2();
            }break;
            case R.id.btn_3:{
                click_btn_3();
            }break;
            case R.id.btn_4:{
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                click_btn_4();
                            }
                        });
                    }
                }).start();
                //click_btn_4();
            }break;
            case R.id.btn_5:{
                click_btn_5();
            }break;
            case R.id.btn_6:{
                click_btn_6();
            }break;
            case R.id.btn_7:{
                testJson_2("json_" + 2 + ".json");
            }break;
            case R.id.btn_8:{
                testJson_2("json_" + 3 + ".json");
            }break;
        }
    }

    @Override
    public void onComplete(FlexibleRichTextView view) {
        Log.i(TAG, "数据全部加载完成222");
        frtvCount++;
        if(frtvList.size() == frtvCount) {
            int h1 = sv_question.getHeight();
            int h2 = sv_question.getChildAt(0).getHeight();
            Log.e(TAG, "滚动高度：h1 = " + h1 + ", h2 = " + h2);
            if(h2 > h1 && isTurnPage) {
                handler.sendEmptyMessageDelayed(HANDLER_COMPLETE_DELEYED, 50);
            }
        }

    }

    private void refreshPageView() {
        tv_page_num.setText((currentPage + 1) + "/" + (totalPage == 0 ? 1 : totalPage));
        btn_page_prev.setClickable(false);
        btn_page_next.setClickable(false);
        btn_page_prev.setTextColor(Color.parseColor("#cccccc"));
        btn_page_next.setTextColor(Color.parseColor("#cccccc"));
        if(currentPage > 0) {
            btn_page_prev.setClickable(true);
            btn_page_prev.setTextColor(Color.parseColor("#000000"));
        }
        if((totalPage - 1) > currentPage){
            btn_page_next.setClickable(true);
            btn_page_next.setTextColor(Color.parseColor("#000000"));
        }
    }

    private void test_01() {
        /*stringBuilder = new StringBuilder();
        stringBuilder.append(str00);
        frtv_00.setText(stringBuilder.toString());
        stringBuilder = new StringBuilder();
        stringBuilder.append(str01);
        frtv_01.setText(stringBuilder.toString());
        stringBuilder = new StringBuilder();
        stringBuilder.append(str02);
        frtv_02.setText(stringBuilder.toString());*/
    }

    private void click_btn_0() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        FlexibleRichTextView frtv = new FlexibleRichTextView(this);
        frtvList.add(frtv);
        frtv.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();
        stringBuilder.append(str_00);
        frtv.setText(stringBuilder.toString());
        lyt_content.addView(frtv);
    }

    private void click_btn_1() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        //View.inflate(parent.getContext(), R.layout.voice_col_item, null);
        for(int i = 0; i < 4; i++) {
            View selectView = LayoutInflater.from(this).inflate(R.layout.item_student_03, lyt_content, false);
            lyt_content.addView(selectView);
            FlexibleRichTextView frtv = (FlexibleRichTextView) selectView.findViewById(R.id.frtv);
            ImageView img_cicle = (ImageView) selectView.findViewById(R.id.img_cicle);
            frtvList.add(frtv);
            singleList.add(img_cicle);
            final int f_i = i;
            selectView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Log.i(TAG, "点击了：" + f_i);
                    for(int j = 0; j < singleList.size(); j++) {
                        if(f_i == j) {
                            singleList.get(j).setImageResource(R.drawable.select_d);
                        } else {
                            singleList.get(j).setImageResource(R.drawable.select_n);
                        }
                    }
                }
            });
            frtv.setOnFlexibleListenerr(this);
            stringBuilder = new StringBuilder();
            if(i == 0) {
                stringBuilder.append(str_01);
            } else if(i == 1) {
                stringBuilder.append(str_02);
            } else if(i == 2) {
                stringBuilder.append(str_03);
            } else if(i == 3) {
                stringBuilder.append(str_04);
            }
            frtv.setText(stringBuilder.toString());
        }
    }

    private void click_btn_2() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        //View.inflate(parent.getContext(), R.layout.voice_col_item, null);
        for(int i = 0; i < 4; i++) {
            View selectView = LayoutInflater.from(this).inflate(R.layout.item_student_03, lyt_content, false);
            lyt_content.addView(selectView);
            FlexibleRichTextView frtv = (FlexibleRichTextView) selectView.findViewById(R.id.frtv);
            ImageView img_cicle = (ImageView) selectView.findViewById(R.id.img_cicle);
            frtvList.add(frtv);
            singleList.add(img_cicle);
            final int f_i = i;
            selectView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Log.i(TAG, "点击了：" + f_i);
                    for(int j = 0; j < singleList.size(); j++) {
                        if(f_i == j) {
                            singleList.get(j).setImageResource(R.drawable.select_d);
                        } else {
                            singleList.get(j).setImageResource(R.drawable.select_n);
                        }
                    }
                }
            });
            frtv.setOnFlexibleListenerr(this);
            stringBuilder = new StringBuilder();
            if(i == 0) {
                stringBuilder.append(FormatUtil.format_option_2(str_05));
            } else if(i == 1) {
                stringBuilder.append(FormatUtil.format_option_2(str_06));
            } else if(i == 2) {
                stringBuilder.append(FormatUtil.format_option_2(str_07));
            } else if(i == 3) {
                stringBuilder.append(FormatUtil.format_option_2(str_08));
            }
            frtv.setText(stringBuilder.toString());
        }
    }
    private void click_btn_3() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        FlexibleRichTextView frtv = new FlexibleRichTextView(this);
        frtvList.add(frtv);
        frtv.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();
        stringBuilder.append(str_09);
        frtv.setText(stringBuilder.toString());
        lyt_content.addView(frtv);
    }
    private void click_btn_4() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        FlexibleRichTextView frtv = new FlexibleRichTextView(this);
        frtvList.add(frtv);
        frtv.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();
        stringBuilder.append(str_10);
        frtv.setText(stringBuilder.toString());
        lyt_content.addView(frtv);
    }

    private void click_btn_5() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        FlexibleRichTextView frtv = new FlexibleRichTextView(this);
        frtvList.add(frtv);
        frtv.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();
        stringBuilder.append(str_11);
        frtv.setText(stringBuilder.toString());
        lyt_content.addView(frtv);
    }

    private void click_btn_6() {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();
        //View.inflate(parent.getContext(), R.layout.voice_col_item, null);

        FlexibleRichTextView frtv_cotent = new FlexibleRichTextView(this);
        frtvList.add(frtv_cotent);
        frtv_cotent.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();
        stringBuilder.append(str_12);
        frtv_cotent.setText(stringBuilder.toString());
        lyt_content.addView(frtv_cotent);

        for(int i = 0; i < 4; i++) {
            View selectView = LayoutInflater.from(this).inflate(R.layout.item_student_03, lyt_content, false);
            lyt_content.addView(selectView);
            FlexibleRichTextView frtv = (FlexibleRichTextView) selectView.findViewById(R.id.frtv);
            ImageView img_cicle = (ImageView) selectView.findViewById(R.id.img_cicle);
            frtvList.add(frtv);
            singleList.add(img_cicle);
            final int f_i = i;
            selectView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Log.i(TAG, "点击了：" + f_i);
                    for(int j = 0; j < singleList.size(); j++) {
                        if(f_i == j) {
                            singleList.get(j).setImageResource(R.drawable.select_d);
                        } else {
                            singleList.get(j).setImageResource(R.drawable.select_n);
                        }
                    }
                }
            });
            frtv.setOnFlexibleListenerr(this);
            stringBuilder = new StringBuilder();
            if(i == 0) {
                stringBuilder.append(FormatUtil.format_option_2(str_13));
            } else if(i == 1) {
                stringBuilder.append(FormatUtil.format_option_2(str_14));
            } else if(i == 2) {
                stringBuilder.append(FormatUtil.format_option_2(str_15));
            } else if(i == 3) {
                stringBuilder.append(FormatUtil.format_option_2(str_16));
            }
            frtv.setText(stringBuilder.toString());
        }
    }

    private void resetTextView() {
        if(frtvList != null && frtvList.size() > 0) {
            for(FlexibleRichTextView frtv : frtvList) {
                frtv.resetTextView();
            }
        }

        currentPage = 0;
        totalPage = 0;
        totalHeight = 0;
        currentHeight = 0;
        refreshPageView();
    }


    private void testJson_2(String fileName) {
        FlexibleRichTextView.load_time = System.currentTimeMillis();

        frtvCount = 0;
        resetTextView();
        frtvList.clear();
        singleList.clear();
        lyt_page_bottom.setVisibility(View.GONE);
        lyt_content.removeAllViews();

        FlexibleRichTextView frtv = new FlexibleRichTextView(this);
        frtvList.add(frtv);
        frtv.setOnFlexibleListenerr(this);
        stringBuilder = new StringBuilder();


        ExamData res = null;
        String json = TestJson.getJson(this, fileName);
        if(JsonUtils.isGoodJson(json)) {
            res = JsonUtils.fromJson(json, ExamData.class);
        }
        if(res != null) {
            stringBuilder.append(res.getData().getName());
            stringBuilder.append(FormatUtil.format_totalQuestion(res.getData().getTotalQuestion().toString()));
            for(ExamData_2 examData_2 : res.getData().getExamQuestionDetailVoList()) {
                if(examData_2.getHasScreen() && examData_2.getQuestionScreen() != null) {
                    stringBuilder.append(FormatUtil.format_questionScreen(examData_2.getQuestionScreen()));
                }
                for(ExamData_3 examData_3 : examData_2.getQuestionList()) {
                    stringBuilder.append(FormatUtil.format_questionNo(examData_3.getQuestionNo().toString()));
                    stringBuilder.append(FormatUtil.format_question(examData_3.getQuestion()));
                    for(int i = 0; i <  examData_3.getOptions().size(); i++) {
                        stringBuilder.append(FormatUtil.format_option(i, examData_3.getOptions().get(i).getValue()));
                    }
                    if(examData_3.getAnswers() != null && examData_3.getAnswers().size() > 0) {
                        for(int i = 0; i <  examData_3.getAnswers().size(); i++) {
                            stringBuilder.append(FormatUtil.format_answers(i, examData_3.getAnswers().get(i).getValue(), examData_3.getAnswers().size()));
                        }
                    } else {
                        stringBuilder.append(FormatUtil.format_answers(0, "", 1));
                    }

                    stringBuilder.append(FormatUtil.format_explain(examData_3.getExplain().getValue()));

                    stringBuilder.append(FormatUtil.format_difficulty(examData_3.getDifficulty()));
                    stringBuilder.append(FormatUtil.format_examinationPoints(examData_3.getExaminationPoints()));
                    stringBuilder.append(FormatUtil.format_score(examData_3.getScore()));
                }
            }
        }
        frtv.setText(stringBuilder.toString());
        lyt_content.addView(frtv);
    }
}
